<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="__STATIC__/lib/html5shiv.js"></script>
<script type="text/javascript" src="__STATIC__/lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="__STATIC__/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="__STATIC__/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>评价管理</title>

<style type="text/css" media="screen">
    /*.p_box {text-align: center}*/
    #pagination-digg li { border:0; margin-top:10px; padding:0; font-size:14px; list-style:none; /* savers */ float: left }
    #pagination-digg a { border:solid 1px #9aafe5; margin-right:2px; }
    #pagination-digg .previous-off,#pagination-digg .next-off { border:solid 1px #DEDEDE; color:#eeeeee; display:block; float:left; font-weight:bold; margin-right:2px; padding:3px 4px; }
    #pagination-digg .next a,#pagination-digg .previous a { font-weight:; }
    #pagination-digg .active { background:#3b80dc; color:#eeeeee; font-weight:bold; display:block; float:left; padding:4px 6px; /* savers */ margin-right:2px; }
    #pagination-digg a:link,#pagination-digg a:visited { color:black; display:block; float:left; padding:3px 6px; text-decoration:none; }
    #pagination-digg a:hover { border:solid 1px #0e509e; }
    .p_box{
      float: right;
    }
 </style>

</head>
<body>

<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 评价管理 <span class="c-gray en">&gt;</span> 评价列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>

<div class="page-container">
  <div class="text-c">
  <form action="commend_list" method="post">
      <input type="text" name="search_name" placeholder=" 搜索内容..... " style="width:250px" class="input-text">
      <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
  </form>
</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"><span class="r">共有数据：<strong>{$res['0']['num']}</strong> 条</span> </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-sort">
			<thead>
				<tr class="text-c">
					<th width="25"><input type="checkbox" name="" value=""></th>
					<th width="70">评论ID</th>
					<th width="80">评论人</th>
					<th width="120">购买商品</th>
					<th width="120">订单编号</th>
					<th width="120">评分</th>
					<th width="120">内容</th>
					<th width="120">评价时间</th>
					<th width="120">状态</th>
					<th width="130">操作</th>
				</tr>
			</thead>
			<?php foreach ($data as $key => $v){ ?>
			<tbody>
				<tr class="text-c">
					<td><input name="" type="checkbox" value=""></td>
					<td>{$v.appraise_id}</td>
					<td>{$v.user_nickname}</td>
					<td>{$v.goods_name}</td>
					<td>{$v.order_sn}</td>
					<td>{$v.appraise_num}</td>
					<td>{$v.appraise_content}</td>
					<td>{$v.appraise_addtime}</td>
			    <td class="td-status">     
              <?php if( $v['status'] == 1 ){ ?>
                   <span class="label label-success radius">已发布</span>
              <?php }?>

              <?php else{ ?>
                   <span class="label label-defaunt radius">已下架</span>
              <?php } ?>
          </td>
          <td class="td-manage abc" where="<?php echo $v['appraise_id'] ?>">

              <?php if( $v['status'] == 0 ){ ?>
                  <a style="text-decoration:none" value="1" onClick="product_start(this,1)" href="javascript:;" title="发布"><i class="Hui-iconfont a">&#xe603;</i></a>
              <?php } ?>

              <?php else{ ?>
                  <a style="text-decoration:none" value="0" onClick="product_stop(this,0)" href="javascript:;" title="下架"><i class="Hui-iconfont a">&#xe6de;</i></a>
              <?php } ?>
          </td>
          
				</tr>
				</tbody>
			<?php } ?>

		</table>

    <div class="p_box">
            <ul id="pagination-digg">
               <li class="next"><a href="{:url('index/commend/commend_list')}?page=1&search_name=<?php echo $search_name ?>">首页 &raquo;</a></li>
                <li><a href="{:url('index/commend/commend_list')}?page=<?php echo $page_arr['prev'] ?>&search_name=<?php echo $search_name ?>">上一页</a></li>

                <li><a href="{:url('index/commend/commend_list')}?page=<?php echo $page_arr['next'] ?>&search_name=<?php echo $search_name ?>">下一页</a></li>
               <li class="next"><a href="{:url('index/commend/commend_list')}?page=<?php echo $page_arr['last'] ?>&search_name=<?php echo $search_name ?>">尾页 &raquo;</a></li>
            </ul>
    </div>

	</div>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__STATIC__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/lib/layer/2.4/layer.js"></script>
<!-- <script type="text/javascript" src="__STATIC__/static/h-ui/js/H-ui.min.js"></script> -->
<!-- <script type="text/javascript" src="__STATIC__/static/h-ui.admin/js/H-ui.admin.js"></script> -->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__STATIC__/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__STATIC__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__STATIC__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">




/*产品-下架*/
function product_stop(obj,id){
    layer.confirm('确认要下架吗？',function(index){
        var appraise_id=$(obj).parents(".abc").attr("where");
     $.ajax({
         url:"{:URL('index/commend/ad_ajaxgai')}",
         data:{status:id,appraise_id:appraise_id},
         success:function(res){
            if(res){                  
               $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="product_start(this,1)" href="javascript:;" title="发布" ><i class="Hui-iconfont">&#xe603;</i></a>');
                $(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">已下架</span>');
                $(obj).remove();
                layer.msg('已下架!',{icon: 5,time:1000});
            }
         }
     })
    
    });
}


/*产品-发布*/
function product_start(obj,id){
    layer.confirm('确认要发布吗？',function(index){
        var appraise_id=$(obj).parents(".abc").attr("where");
        $.ajax({
         url:"{:URL('index/commend/ad_ajaxgai')}",
         data:{status:id,appraise_id:appraise_id},
         success:function(res){
        if(res){                  
             var appraise_id=$(obj).parents(".abc").attr("where");
        $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="product_stop(this,0)" href="javascript:;" title="下架"><i class="Hui-iconfont">&#xe6de;</i></a>');
          $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已发布</span>');
          $(obj).remove();
          layer.msg('已发布!',{icon: 6,time:1000});
              }
         }
     })
  });
}
</script>
</body>
</html>